<html>
<head><meta charset="utf-8"><title>cross-compiling question · t-infra · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/index.html">t-infra</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html">cross-compiling question</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203254692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203254692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203254692">(Jul 08 2020 at 11:06)</a>:</h4>
<p>Hi all, I'm trying to follow this: <a href="https://github.com/rust-lang/rust/tree/master/src/ci/docker">https://github.com/rust-lang/rust/tree/master/src/ci/docker</a> to cross-compile for various platforms. <br>
Unfortunately, I can't get it to work. <br>
I've tried released source-tarball of 1.43 and 1.44, as well as a recent git-checkout with <code>dist-s390x-linux</code>, <code>dist-powerpc64-linux</code> and <code>dist-powerpc64le-linux</code>. The ppc-variants both fail to compile due to an assertion in <code>rustc_middle</code> in stage 1, s390x fails with no error-output whatsoever in <code>rustc_mir</code>.  <br>
I feel like I'm missing something. I ran <code>./x.py build</code> once (just to be sure), then <code>./src/ci/docker/run.sh dist-powerpc64-linux</code>. This downloads a lot, compiles for an hour or more and then fails at some point. <br>
Are there any extra setup steps I have to do? I'm probably doing something stupid, but can't figure it out</p>



<a name="203255489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203255489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203255489">(Jul 08 2020 at 11:17)</a>:</h4>
<p><span class="user-mention" data-user-id="319327">@msirringhaus</span> don't run a <code>./x.py build</code> before starting the docker build</p>



<a name="203255554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203255554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203255554">(Jul 08 2020 at 11:18)</a>:</h4>
<p>remove the <code>obj</code>and <code>build</code> directories and try again :)</p>



<a name="203255562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203255562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203255562">(Jul 08 2020 at 11:18)</a>:</h4>
<p>(also remove them when switching between builders)</p>



<a name="203255627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203255627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203255627">(Jul 08 2020 at 11:19)</a>:</h4>
<p>I did remove <code>obj</code> at some point, but never <code>build</code>. Trying again</p>



<a name="203255647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203255647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203255647">(Jul 08 2020 at 11:19)</a>:</h4>
<p>Thanks! Will report back :)</p>



<a name="203258251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203258251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203258251">(Jul 08 2020 at 11:52)</a>:</h4>
<p>Hm, nope. Still getting the same error:</p>
<div class="codehilite"><pre><span></span><code>$ rm -rf obj build
$  ./src/ci/docker/run.sh dist-s390x-linux
...
[TIMING] Llvm { target: &quot;s390x-unknown-linux-gnu&quot; } -- 162.297
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -&gt; s390x-unknown-linux-gnu)
   Compiling cfg-if v0.1.10
   Compiling libc v0.2.69
....
Unknown type!
UNREACHABLE executed at /checkout/src/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:316!
[RUSTC-TIMING] rustc_mir test:false 90.595
rustc exited with signal: 6
error: could not compile `rustc_mir`.
</code></pre></div>



<a name="203261606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203261606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203261606">(Jul 08 2020 at 12:35)</a>:</h4>
<p>and still</p>
<div class="codehilite"><pre><span></span><code>rustc: /checkout/src/llvm-project/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1142: unsigned int {anonymous}::BitPermutationSelector::ValueBit::getValueBitIndex() const: Ass
ertion `hasValue() &amp;&amp; &quot;Cannot get the value bit index of a constant bit&quot;&#39; failed.
[RUSTC-TIMING] rustc_ast_passes test:false 16.043
rustc exited with signal: 6
error: could not compile `rustc_ast_passes`.
</code></pre></div>


<p>for ppc-builds</p>



<a name="203270478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203270478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nell Shamrell-Harrington <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203270478">(Jul 08 2020 at 14:00)</a>:</h4>
<p>o?</p>



<a name="203270508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203270508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nell Shamrell-Harrington <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203270508">(Jul 08 2020 at 14:00)</a>:</h4>
<p>nvm, wrong topic</p>



<a name="203314971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203314971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203314971">(Jul 08 2020 at 19:58)</a>:</h4>
<p><span class="user-mention" data-user-id="319327">@msirringhaus</span> what if you run <code>DEPLOY=1 ./src/ci/docker/run.sh dist-s390x-linux</code>?<br>
That should give you the same config as on Rust CI.</p>



<a name="203357620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203357620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203357620">(Jul 09 2020 at 07:33)</a>:</h4>
<p>Again a different error. This time in miri:</p>
<div class="codehilite"><pre><span></span><code>   Compiling miri v0.1.0 (/checkout/src/tools/miri)
[RUSTC-TIMING] build_script_build test:false 0.243
error[E0478]: lifetime bound not satisfied
....
error: aborting due to 22 previous errors

Some errors have detailed explanations: E0478, E0495.
For more information about an error, try `rustc --explain E0478`.
[RUSTC-TIMING] miri test:false 0.536
error: could not compile `miri`.
</code></pre></div>



<a name="203361427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203361427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203361427">(Jul 09 2020 at 08:27)</a>:</h4>
<p>Miri error should not be fatal, if it stops the compilation you should backport <a href="https://github.com/rust-lang/rust/pull/73232">https://github.com/rust-lang/rust/pull/73232</a></p>



<a name="203501876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/cross-compiling%20question/near/203501876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> msirringhaus <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/cross-compiling.20question.html#203501876">(Jul 10 2020 at 12:45)</a>:</h4>
<p>Thanks, now I'm getting somewhere. That documentation-page in <code>ci/docker/</code> is completely out of date btw. I probably could update that (even though I only half-know what I'm doing)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>